<template>
  <div >
       <!-- <h2>{{ news.title }}</h2>
        <p>{{ news.content }}</p> -->
       <h2>{{ news.a }}</h2>
        <p>{{ news.b }}</p>
       <!-- <h2>{{ params.title }}</h2>
        <p>{{ params.content }}</p> -->
  </div>
</template>
<script>

export default {
  name: 'newsDea',
  data(){
    return{
      params:{},
      news:{}
    }
  },
  created () {
    console.log(this.$route.params)
    // this.$route.params.a
    this.news = this.$route.params;
    // this.news = this.$route.query;
    // console.log('news',this.news);
    // this.params = this.$route.params;
    // this.news = this.$route.params;//优点会保存数据 缺点是会将参数拼接到路径明文中
    // console.log(this.$route)//取对象里面的数据this.$route 跳转用this.$router
    // console.log(this.$route.params)//取对象里面的数据this.$route 跳转用this.$router
    // // console.log(this.params)//取对象里面的数据this.$route 跳转用this.$router
    // console.log(this.news)//取对象里面的数据this.$route 跳转用this.$router
    // console.log(this.$route.params)
  }
}
</script>

<style lang="scss">
h2{
  height: 30px;
  font-size: 30px;
}
</style>
